#include "qt_synthesis.h"
#include "ui_qt_synthesis.h"
#include "QMessageBox"
Qt_synthesis::Qt_synthesis(QWidget *parent) :
    QMainWindow(parent),
    ui(new Ui::Qt_synthesis)
{
    ui->setupUi(this);
}

Qt_synthesis::~Qt_synthesis()
{
    delete ui;
}

void Qt_synthesis::on_logbtn_clicked()
{
    if(ui->cin_zh->text()== username){
        if(ui->cin_mima->text()== password){
              QMessageBox::information(this,"登录消息","登录成功",QMessageBox::Yes,QMessageBox::Yes);
              if(f2==nullptr)
              {
                  f2 = new home(this); //new 一个新的home
                  this->hide();//当前页面隐藏不销毁
                  f2->show();
              }else{
                  this->hide();//当前页面隐藏不销毁
                  f2->show();
              }

        }
        else {
              QMessageBox::critical(this,"登录消息","密码错误",QMessageBox::Yes,QMessageBox::Yes);
        }
    }else {
        QMessageBox::critical(this,"登录消息","账号错误",QMessageBox::Yes,QMessageBox::Yes);
    }
}
